package jee.boot.module.sms.interceptor;

import jee.boot.common.utils.SpringContextHolder;
import jee.boot.entity.sms.Sms;
import jee.boot.module.sms.service.SmsService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * 默认的短信发送后置处理
 *
 * @author zhilei.wang
 */
public class DefaultSmsPostInterceptor implements SmsInterceptor {
    private Log log = LogFactory.getLog(DefaultSmsPostInterceptor.class);

    @Override
    public void process(Sms sms) throws Exception {
        SmsService service = SpringContextHolder.getApplicationContext().getBean(SmsService.class);
        // 短信发送后,本地保存记录
        service.save(sms);
    }
}
